﻿using Ewelve_Mouth_HD.DAL;
using Ewelve_Mouth_HD.Model;

namespace Ewelve_Mouth_HD.BLL
{
    public class NubBll
    {
        private readonly NubDal nubDal;

        public NubBll(NubDal _nubDal)
        {
            nubDal = _nubDal;
        }
        /// <summary>
        /// 房号添加
        /// </summary>
        /// <param name="E"></param>
        /// <returns></returns>
        public int NubAdd(RoomNub E)
        {
            try
            {
                return nubDal.NubAdd(E);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 查询显示房号
        /// </summary>
        /// <param name="NubCard"></param>
        /// <param name="TypeName"></param>
        /// <param name="StartDate"></param>
        /// <param name="EndDate"></param>
        /// <returns></returns>
        public IQueryable RoomNubShow(string? NubCard, int TypeName, DateTime? StartDate, DateTime? EndDate)
        {
            try
            {
                return nubDal.RoomNubShow(NubCard, TypeName, StartDate, EndDate);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 查询单个数据
        /// </summary>
        /// <param name="NubId"></param>
        /// <returns></returns>
        public RoomNub FirstOnly(int NubId)
        {
            try
            {
                return nubDal.FirstOnly(NubId);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="NubId"></param>
        /// <returns></returns>
        public int DropNup(int NubId)
        {
            try
            {
                return nubDal.DropNup(NubId);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="NubId"></param>
        /// <param name="NubStage"></param>
        /// <returns></returns>
        public int EditStage(int NubId, int NubStage)
        {
            try
            {
                return nubDal.EditStage(NubId, NubStage);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="Y"></param>
        /// <returns></returns>
        public int EditNub(RoomNub Y)
        {
            try
            {
                return nubDal.EditNub(Y);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量逻辑删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public int SumDrop(string ids)
        {
            try
            {
                return nubDal.SumDrop(ids);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 批量修改状态
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="NubStage"></param>
        /// <returns></returns>
        public int SumEditSatage(string ids, int NubStage)
        {
            try
            {
                return nubDal.SumEditSatage(ids, NubStage);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 绑定下拉框
        /// </summary>
        /// <returns></returns>
        public IQueryable NubShow()
        {
            try
            {
                return nubDal.NubShow();
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}